package com.cqie.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cqie.ssm.bean.Course;
import com.cqie.ssm.bean.CourseExample;
import com.cqie.ssm.dao.CourseMapper;
import com.cqie.ssm.service.CourseService;

@Service("courseService")
public class CourseServiceImpl implements CourseService {

	@Autowired(required = false)
    CourseMapper courseMapper;
	
	@Override
	public List<Course> selectByExample(CourseExample example) {
		return courseMapper.selectByExample(example);
	}

	@Override
	public Integer addCourse(Course course) {
		courseMapper.insertSelective(course);
        return course.getCourseId();
	}

	@Override
	public void updateCourseById(Course course) {
		courseMapper.updateByPrimaryKeySelective(course);		
	}

}
